package com.ler.yrmall.product.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ler.yrmall.basic.BaseVO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * spu
 * @author leron
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SpuVO extends BaseVO {

    private String name;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<String> categoryPath;

    /**
     * 分类路径 A/B/C
     */
    private String categoryPathName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long categoryId;

    private Integer sort;

    /**
     * 分类路径 id1,id2,id3
     */
    private String categoryPathIdStr;

    /**
     * 所属品牌
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long brandId;

    /**
     * 品牌名称
     */
    private String brandName;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * 状态 0 上架 1 下架 todo 枚举抽取
     */
    private Integer status;

    /**
     * 主图片
     */
    private String mainImg;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private SpuSaleMinPriceVO saleMinPrice;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
